<!doctype html>
<html xmlns:th="www.thymeleaf.org">
<meta charset="utf-8">
<head th:replace="index::head"></HEAD>
<BODY>
	<header th:replace="index::#ph"></header>
	<!--      导航        -->
	<div style="padding: 3px 8px">
		<span class="layui-breadcrumb">
			<a href="/">作业论坛首页</a>
			<a>
				<cite>重置密码</cite>
			</a>
		</span>
	</div>
	<!--      用户登录表单        -->
	<DIV class="t" style="MARGIN-TOP: 15px" align="center">
		<form class="layui-form layui-main" style="width: 500px">
			<div class="layui-form-item">
				<label class="layui-form-label">账号或邮箱：</label>
				<div class="layui-input-block">
					<input v-model="user.account" class="layui-input"
						placeholder="输入账户或您的个人信息中填写的邮箱地址">
				</div>
			</div>
			<div class="layui-form-item" style="float: right;">
				<button @click="save" type="button" class="layui-btn">发送重置邮件</button>
				<button onclick="window.history.back();" type="button"
					class="layui-btn">返回</button>
			</div>
			<div style="clear: both;"></div>
		</form>
	</DIV>
	<script type="text/javascript">
	var v = new Vue({
		el : ".t",
		data : { user: {account:""} },
		methods : {
			save(){
				get("forget?account="+this.user.account,null,res=>{
					alert("邮件已经发送到您的邮箱，请查收并完成密码重置！", 3000).then(()=>{
						location.href="/";
					});
				})
			}
		}
	})
	layui.element.render();
	</script>
	<!-- 导入页脚 -->
	<footer th:replace="index::footer"></footer>
</BODY>
<script th:if="${result?.code}==0">
	alert("[[${result.msg}]]",3000,6);
</script>
</HTML>
